Skip to content

ci(desktop): notarize and staple the macOS DMG - #194

Merged
elkaix merged 1 commit into
mainfrom
fix/notarize-desktop-dmg
Aug 25, 2026
Merged

ci(desktop): notarize and staple the macOS DMG#194
elkaix merged 1 commit into
mainfrom
fix/notarize-desktop-dmg

Conversation

@elkaix

@elkaix elkaix commented Aug 25, 2026

Copy link
Copy Markdown
Member

Problem

Users downloading Pythinker-0.3.1-arm64.dmg from the site see "Pythinker.app is damaged and can't be opened". The app bundle inside is signed, notarized and stapled, but the DMG itself only carries a Developer ID signature: spctl --assess --type open reports rejected, Unnotarized Developer ID. Gatekeeper on recent macOS surfaces that for quarantined browser downloads as "damaged".

What changed

  • New Notarize and staple macOS DMG step: xcrun notarytool submit --wait (API key preferred, Apple ID fallback — the same credentials electron-builder already uses) then stapler staple the image.
  • The verification step now also runs stapler validate and spctl --assess --type open --context context:primary-signature on the DMG, so a release can no longer ship an unnotarized image. Checked locally: this gate fails on the current 0.3.1 DMG.

[skip changeset] — CI-only, no user-visible package change.

electron-builder notarizes and staples the .app but not the disk image
around it. A quarantined, unnotarized DMG is what Gatekeeper reports as
"Pythinker.app is damaged and can't be opened" for browser downloads.
Submit the DMG to notarytool, staple it, and gate the release on
"spctl --assess --type open" accepting the image itself.
@elkaix
elkaix enabled auto-merge (squash) August 25, 2026 19:46
@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@f63a421
npx https://pkg.pr.new/@pymodel/pythinker-code@f63a421

commit: f63a421

@elkaix
elkaix merged commit 8e261fd into main Aug 25, 2026
24 checks passed
@elkaix
elkaix deleted the fix/notarize-desktop-dmg branch August 25, 2026 19:49
elkaix added a commit that referenced this pull request Aug 25, 2026
## Problem
Desktop 0.3.1 shipped an unnotarized DMG that macOS reports as
"Pythinker.app is damaged". #194 fixed the release pipeline; a new
version is needed to ship it.

## What changed
`apps/desktop/package.json` 0.3.1 → 0.3.2. After merge, tag
`desktop-v0.3.2` on the merge commit to cut the release.

[skip changeset] — desktop app versions are not managed by changesets.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Updated the desktop application to version 0.3.2.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
elkaix added a commit that referenced this pull request Aug 25, 2026
## Problem
`desktop-v0.3.2` failed at **Verify macOS update artifacts**:
`Pythinker-0.3.2-arm64.dmg size does not match latest-mac.yml`. The
notarize step from #194 stapled the DMG after electron-builder had
written the manifest, so size/sha512 (and the `.dmg.blockmap`) went
stale. Notarization itself succeeded.

## What changed
- The workflow now runs `apps/desktop/scripts/finalize-mac-artifacts.ts`
(already used by `dist:mac`, covered by
`tests/finalize-mac-artifacts.spec.ts`): notarytool submit → staple →
rewrite the DMG entry in `latest-mac.yml` → drop the stale blockmap
(full download instead of differential; the zip still has its blockmap).
- Added a CLI entry to that script (`finalize-mac-artifacts.ts
<dist-dir>`), same pattern as the other release scripts.
- Removed the hand-written shell step it replaces. The DMG-level
`stapler validate` + `spctl --type open` gate stays.

After merge, `desktop-v0.3.2` will be re-tagged on the merge commit
(0.3.2 was never published).

[skip changeset] — CI-only.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved macOS release artifact finalization, including notarization
and stapling.
- Updated release manifests automatically and removed stale blockmap
files.
- Improved error handling so release failures are reported clearly and
return a failure status.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant